﻿using System.Windows;
using Telerik.Windows.Controls;
using HierarchicalDataTemplate = Telerik.Windows.Controls.HierarchicalDataTemplate;

namespace MedLink2011.Views.Patients.Controls.FirstLook
{
    public class CalendarDataTemplateSelector : DataTemplateSelector
    {
        public DataTemplate EventTemplate { get; set; }

        public HierarchicalDataTemplate CategoryTemplate { get; set; }

        public CalendarDataTemplateSelector()
        {
        }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            base.SelectTemplate(item, container);

            if (item is CalendarCategory)
            {
                return this.CategoryTemplate;
            }
            else if (item is Event)
            {
                return this.EventTemplate;
            }

            return null;
        }
    }
}
